<template>
	<view class="sz">
		<view class="szitem">

			<!-- 个人相关 -->
			<view class="xinxi">
				<!-- 个人资料 -->
				<view class="itemgr" @click="gopage('个人资料')">
					<view class="left">
						<image src="/static/shezhi/个人资料.png" mode=""></image>
						<text>个人资料</text>
					</view>
					<view class="right">
						<text>></text>
					</view>
				</view>
				<view class="itemgr">
					<view class="left">
						<image src="/static/shezhi/实名认证.png" mode=""></image>

						<text>实名认证</text>
					</view>
					<view class="right">
						<text
							:style="{ color: isAuthenticated ? 'green' : 'red', marginRight: '5px',fontSize:'16px'  }">{{ isAuthenticated ? '已认证' : '未认证' }}</text>
						<text>></text>
					</view>
				</view>
				<!-- 	<view class="itemgr" @click="gopage('重置密码')">
					<view class="left">
						<image src="/static/shezhi/设置密码.png" mode=""></image>

						<text>重置密码</text>
					</view>
					<view class="right">

						<text>></text>
					</view>
				</view> -->
				<view class="itemgr">
					<view class="left">
						<image src="/static/shezhi/用户协议.png" mode=""></image>
						<text>用户协议</text>
					</view>
					<view class="right">
						<text>></text>
					</view>
				</view>
				<view class="itemgr">
					<view class="left">
						<image src="/static/shezhi/quanxianguanli6.png" mode=""></image>
						<text>隐私政策</text>
					</view>
					<view class="right">
						<text>></text>
					</view>
				</view>
				<view class="itemgr" @click="gopage('关于我们')">
					<view class="left">
						<image src="/static/shezhi/关于我们.png" mode=""></image>
						<text>关于我们</text>
					</view>
					<view class="right">
						<text>></text>
					</view>
				</view>
				<!-- 分割线 -->
				<u-divider lineColor="#dbe2f6"></u-divider>
				<view class="itemgr" style="margin-top: 8px;">
					<view class="left">
						<image src="/static/shezhi/清空.png" mode=""></image>

						<text>清除缓存</text>
					</view>
					<view class="right">
						<text class="dat">126k</text>
						<text>></text>
					</view>
				</view>
				<view class="itemgr" style="margin-top: 8px;">
					<view class="left">
						<image src="/static/shezhi/注销.png" mode=""></image>

						<text>账号注销</text>
					</view>
					<view class="right">

						<text>></text>
					</view>
				</view>
				<!-- 分割线 -->
				<u-divider lineColor="#dbe2f6"></u-divider>
				<!-- 退出登录按钮 -->
				<u-button iconColor="#f8c29f" color="#f8c29f" style="margin-top: 40px;" type="primary" :plain="true"
					text="退出登录" shape="circle" @click="goOut"></u-button>

			</view>


		</view>

	</view>
</template>

<script>
	import {
		mapActions
	} from 'vuex'
	export default {
		data() {
			return {
				isAuthenticated: false, // 根据实际条件设置该值
				userinfo: {}
			}
		},
		onLoad() {
			// console.log('ss', this.userInfo);
			const aa = uni.getStorageSync("userinfo")
			if (aa) {
				this.userinfo = {
					...JSON.parse(aa)
				}
			} else {
				this.userinfo = {}
			}
		},
		methods: {
			...mapActions(["Logout"]),

			gopage(e) {
				if (e == "个人资料") {
					this.$toPage("/view/InformationSettings/InformationSettings", "id", 2)
				}
				if (e == "重置密码") {
					this.$toPage("/view/passwordReset/passwordReset", "id", 2)
				}
				if (e == "关于我们") {
					this.$toPage("/view/aboutUs/aboutUs")
				}


			},
			goOut() {
				const {
					Logout
				} = this
				Logout().then(res => {
					// console.log('登录退出', res);
					uni.navigateBack()
				})
			}

		}
	}
</script>

<style lang="less">
	.sz {
		background-color: #dbe2f6;
		height: 100%;

		.szitem {
			.xinxi {
				margin-top: 8px;
				background-color: #ffffff;
				border-radius: 5px;

				.itemgr {
					padding: 5px 15px;
					margin-top: 2px;
					display: flex;
					justify-content: space-between;

					.left {
						display: flex;
						align-items: center;

						image {
							width: 26px;
							height: 26px;
						}

						text {
							margin-left: 15px;
							font-size: 18px;
							color: #4b474a;
						}

					}

					.right {

						.dat {
							font-size: 14px;
							margin-right: 5px;
						}

						text {
							font-size: 18px;
							color: #4b474a;
						}
					}

				}

			}

		}

	}
</style>